#include<iostream>
#include<cstring>
#include<string>
#include<queue>
using namespace std;
typedef long long LL;
priority_queue<int>q;
int n;
int main()
{
	string str;
	getline(cin, str);
	int ans = 0;
	for (int i = 0; i < str.size(); i++) {
		if (str[i] != ' ' && str[i] != '\n') {
			ans++;
		}
	}
	cout << ans << endl;
	return 0;
}